
import { _decorator, Component, Node, Button } from 'cc';
import { GameMgr } from './GameMgr';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = UIMgr
 * DateTime = Tue Mar 08 2022 15:08:45 GMT+0800 (中国标准时间)
 * Author = lamd
 * FileBasename = UIMgr.ts
 * FileBasenameNoExtension = UIMgr
 * URL = db://assets/Scripts/UIMgr.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */

@ccclass('UIMgr')
export class UIMgr extends Component {
    startUI: Node = null!;
    start() {
        this.startUI = this.node.getChildByName("StartUI")
        this.startUI.getChildByName("btnPlay").on(Button.EventType.CLICK, () => {
            GameMgr.instance.gameStart();
            this.startUI.active = false;
        }, this)
    }

    showStartUI() {
        this.startUI.active = false;
    }

}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
